package com.yidu.controller;

import com.yidu.entity.Person;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 类的描述：...
 *
 * @author sunny
 * @version 1.0
 * @since 2022/05/30
 */
@RestController
public class HelloController {
    @Value("${name}")
    private String userName;

    @Value("${server.port}")
    private String port;

    @Autowired
    private Person person;

    @RequestMapping("/sayHello")
    public String sayHello(String userName){
        return userName+",你好呀！";
    }

    @RequestMapping("/getUserName")
    public String getUserName(){
        return userName;
    }

    @RequestMapping("/getPort")
    public String getPort(){
        return port;
    }

    @RequestMapping("/getPerson")
    public Person getPerson(){
        return person;
    }

}
